var excel = require('./excel');
var json = require('./dcv-all.json');

var conf = {};
conf.cols = [
  {caption: 'code', type: 'string'},
  {caption: 'zh', type: 'string'},
  {caption: 'en', type: 'string'}
];
conf.rows = json.map(function(obj){
  return [obj.code, obj.lanZhc, obj.lanEn];
});
var filename = "导出excel.xlsx";
// res.setHeader('Content-Disposition', 'attachment; filename='+encodeURIComponent(filename));
excel.createExcel({
  data: conf,
  savePath: "./",
  cb: function (path) {
    // excel.download(path,req, res,true);
    console.log('path=' + path);
  }
});
